n,*a=map(int,open(0));print(sum(map(max,zip(a,a[1:]))))